﻿/************************************************************************

   Extended Silverlight Toolkit

   Copyright (C) 2010-2012 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://extendedsilverlight.codeplex.com/license

   Please purchase a commercial version of this toolkit if you are using
   it in a commercial product. The commercial versions support the project,
   and also include more features for each control, priority support,
   source code, updates, removed watermark, and a proprietary license.

   Visit http://xceed.com and follow @datagrid on Twitter.

  **********************************************************************/

using System;

namespace Xceed.Silverlight.Data
{
  public sealed class UnhandledDataExceptionEventArgs : EventArgs
  {
    internal UnhandledDataExceptionEventArgs( Exception exception )
      : this( exception, ErrorResultAction.Abort, 0 )
    {
    }

    internal UnhandledDataExceptionEventArgs( Exception exception, int retryCount )
      : this( exception, ErrorResultAction.Abort, retryCount )
    {
    }

    internal UnhandledDataExceptionEventArgs( 
      Exception exception, 
      ErrorResultAction defaultResult )
      : this( exception, defaultResult, 0 )
    {
    }

    internal UnhandledDataExceptionEventArgs( 
      Exception exception, 
      ErrorResultAction defaultResult, 
      int retryCount )
    {
      this.Exception = exception;
      this.Result = defaultResult;
      this.RetryCount = retryCount;
    }


    #region Handled Property

    public bool Handled
    {
      get;
      set;
    }

    #endregion Handled Property

    #region Result Property

    public ErrorResultAction Result
    {
      get;
      set;
    }

    #endregion Result Property

    #region Exception Property

    public Exception Exception
    {
      get;
      private set;
    }

    #endregion Exception Property

    #region RetryCount Property

    public int RetryCount
    {
      get;
      private set;
    }

    #endregion RetryCount Property
  }
}
